package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.query.UserQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface UserMapper {
    int insert(User record);

    List<User> selectForList(QueryObject qo);

    int updateByPrimaryKey(User record);

    String selectByEmail(String email);

    User selectByInfo(@Param("email") String email,
                      @Param("password") String password);

    List<User> selectFriendForUserId(UserQueryObject qo);

    List<User> selectlistApplyFriendById(UserQueryObject qo);

    void insertTravelRelation(@Param("travelId") Long travelId, @Param("userId") Long userId,@Param("creatTime") Date date);

    void deleteTravelRelation(@Param("travelId") Long travelId, @Param("userId") Long userId);

    Map<String,Object> selectEnshrineRelation(@Param("travelId") Long travelId, @Param("userId") Long userId);


    User selectByUserId(Long id);

    Map<String,Object> selectAttentionRelation(@Param("attentionId") Long attentionId, @Param("userId") Long userId);

    void deleteAttentionRelation(@Param("attentionId") Long attentionId, @Param("userId") Long userId);

    void insertAttentionRelation(@Param("attentionId") Long attentionId, @Param("userId") Long userId);

    Map<String,Object> selectAttentionNumber(Long id);

    Map<String,Object> selectFansNumber(Long id);

}